package com.weixing.mall.provider.model.vo.report.product;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.GlobalConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

/**
 * @author jzy
 * @date 2020/6/9
 */
@Data
@ApiModel(value="ProductSaleDetailVo", description="商品部报表-2销售明细")
@ContentRowHeight(40)
public class ProductSaleDetailVo {
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String goodsImg;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    @ApiModelProperty(value = "分类")
    @ExcelProperty("分类")
    private String partitionName;
    @ApiModelProperty(value = "系列")
    @ExcelProperty("系列")
    private String goodsSys;
    @ApiModelProperty(value = "季节")
    @ExcelProperty("季节")
    private String gsSeason;
    @ApiModelProperty(value = "商品类型")
    @ExcelProperty("商品类型")
    private String catName;
    @ApiModelProperty(value = "商品货号")
    @ExcelProperty("商品货号")
    private String goodsSn;
    @ApiModelProperty(value = "专柜价")
    @ExcelProperty("专柜价")
    private BigDecimal marketPrice;
    @ApiModelProperty(value = "零售价")
    @ExcelProperty("零售价")
    private BigDecimal price;
    @ApiModelProperty(value = "优惠价")
    @ExcelProperty("优惠价")
    private BigDecimal discountPrice;
    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;
    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;
    @ApiModelProperty(value = "订单数量-尺码 ")
    @ExcelProperty("订单数量-尺码")
    private String quantitySize;
    @ApiModelProperty(value = "订单数量-颜色 ")
    @ExcelProperty("订单数量-颜色")
    private String quantityColor;
    @ApiModelProperty(value = "订单数量")
    @ExcelProperty("订单数量")
    private Integer quantity;
    @ApiModelProperty(value = "断货量-尺码")
    @ExcelProperty("断货量-尺码")
    private String stockoutQuantitySize;
    @ApiModelProperty(value = "断货量-颜色")
    @ExcelProperty("断货量-颜色")
    private String stockoutQuantityColor;
    @ApiModelProperty(value = "断货量")
    @ExcelProperty("断货量")
    private Integer stockoutQuantity;
    @ApiModelProperty(value = "取消量-尺码")
    @ExcelProperty("取消量-尺码")
    private String cancelQuantitySize;
    @ApiModelProperty(value = "取消量-颜色")
    @ExcelProperty("取消量-颜色")
    private String cancelQuantityColor;
    @ApiModelProperty(value = "取消量")
    @ExcelProperty("取消量")
    private Integer cancelQuantity;
    @ApiModelProperty(value = "退货量-尺码")
    @ExcelProperty("退货量-尺码")
    private String returnQuantitySize;
    @ApiModelProperty(value = "退货量-颜色")
    @ExcelProperty("退货量-颜色")
    private String returnQuantityColor;
    @ApiModelProperty(value = "退货量")
    @ExcelProperty("退货量")
    private Integer returnQuantity;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "订单创建时间（下单时间）")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("下单时间")
    private Date createdTime;
    @ApiModelProperty(value = "客服审核时间---修改")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("客服审核时间")
    private Date auditTime;
}
